package com.example.tests;

import java.util.Collections;
import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

public class ContactRemovalTests extends TestBase{
	
	@Test
	public void testDeleteContact() {
		app.getNavigationHelper().openMainPage();
		
		List<GroupData> oldList = app.getGroupHelper().getGroups();
		
		app.getContactHelper().initContactEditing(1);
		app.getContactHelper().deleteContact();
		app.getContactHelper().returnToHomePage();
		
		List<GroupData> newList = app.getGroupHelper().getGroups();
	    
		oldList.remove(0);
	    Collections.sort(oldList);
	    Collections.sort(newList);
		  
	    Assert.assertEquals(newList, oldList);
	    
	}
}
